import request from '@/utils/request'
/**
 * 获取分类列表
 * @returns promise对象
 */
export const getCateListAPI = () => {
  return request({
    url: '/home/category/head'
  })
}

/**
 * 获取品牌推荐
 * @param {*} limit 请求品牌推荐的条数
 * @returns promise对象
 */
export const getBrandAPI = (limit = 9) => {
  return request({
    url: '/home/brand',
    params: {
      limit
    }
  })
}

/**
 * 获取轮播图数据
 * @returns promise对象
 */
export const getCarouselAPI = () => {
  return request({
    url: '/home/banner',
    params: {
      distributionSite: 1
    }
  })
}

/**
 * 获取首页新鲜好物
 * @returns promise对象
 */
export const getHomeNewAPI = (limit) => {
  return request({
    url: '/home/new',
    params: {
      limit: 4
    }
  })
}

/**
 * 获取首页人气推荐
 * @returns promise对象
 */
export const getHomeHotAPI = () => {
  return request({
    url: '/home/hot'
  })
}

/**
 * 获取产品区域
 * @returns promise对象
 */
export const getHomeProductAPI = () => {
  return request({
    url: '/home/goods'
  })
}
